﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DTO;
using BUS;
using System.Collections.Generic;

public partial class admin_News : System.Web.UI.Page
{
    NewsTypeBUS newsTypeBUS = new NewsTypeBUS();
    PanelBUS panelBUS = new PanelBUS();
    List<NewsTypeDTO> ntList;
    List<PanelDTO> panelList;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["adminName"] == null)
            Response.Redirect("login.aspx?turn=adminaccounts.aspx");
        if (!IsPostBack)
        {
            ntList = newsTypeBUS.GetActiveNewsType();
            panelList = panelBUS.GetAllActiveSubPanels();
            cbbPanel.DataSource = panelList;
            cbbType.DataSource = ntList;
            cbbPanel.Items.Clear();
            cbbType.Items.Clear();
            foreach (var p in panelList)
            {
                cbbPanel.Items.Add(new Telerik.Web.UI.RadComboBoxItem(p.Name, p.PanelID.ToString()));
            }
            foreach (var p in ntList)
            {
                cbbType.Items.Add(new Telerik.Web.UI.RadComboBoxItem(p.TypeName, p.TypeID.ToString()));
            }
        }
    }
}
